﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Gatheshop.Web.UI;
using System.Data;
using Gatheshop.Web.Plugin.Feedback.BLL;
using Gatheshop.Common;

namespace Gatheshop.Web.Plugin.Feedback
{
    public class feedbackpage : BasePage
    {
        // Fields
        protected int page;
        protected int totalcount;

        // Methods
        public DataTable get_feedback_list(int top, string strwhere)
        {
            DataTable table = new DataTable();
            string strWhere = "is_lock=0";
            if (!string.IsNullOrEmpty(strwhere))
            {
                strWhere = strWhere + " and " + strwhere;
            }
            return new feedbackBLL().GetList(top, strWhere).Tables[0];
        }

        public DataTable get_feedback_list(int page_size, int page_index, string strwhere, out int totalcount)
        {
            DataTable table = new DataTable();
            string strWhere = "is_lock=0";
            if (!string.IsNullOrEmpty(strwhere))
            {
                strWhere = strWhere + " and " + strwhere;
            }
            return new feedbackBLL().GetList(page_size, page_index, strWhere, "add_time desc", out totalcount).Tables[0];
        }

        protected override void ShowPage()
        {
            this.page = GESRequest.GetQueryInt("page", 1);
        }
    }


}